﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Littlefish.Data;

namespace Littlefish.Model.Objects
{
    public class Race : BaseBusinessObject<Data.DemographicRace, MainDataContext>
    {
        #region - Constructors -
        internal Race() : base() { }
        internal Race(MainDataContext context) : base(context) { }
        internal Race(MainDataContext context, DemographicRace entity)
            : base(context)
        {
            this.Entity = entity;
        }
        #endregion

        #region - Static Methods -
        public static Race CreateRace()
        {
            return CreateRace(null, null);
        }
        public static Race CreateRace(BusinessObjectOptions options)
        {
            return CreateRace(null, options);
        }
        public static Race CreateRace(MainDataContext context)
        {
            return CreateRace(context, null);
        }
        public static Race CreateRace(MainDataContext context, BusinessObjectOptions options)
        {
            Race race = new Race(context);
            if (options != null)
                race.Options = options;

            race.NewEntity();
            return race;
        }

        public static Race GetRace(int id)
        {
            return GetRace(id, null, null);
        }
        public static Race GetRace(int id, BusinessObjectOptions options)
        {
            return GetRace(id, null, options);
        }
        public static Race GetRace(int id, MainDataContext context)
        {
            return GetRace(id, context, null);
        }
        public static Race GetRace(int id, MainDataContext context, BusinessObjectOptions options)
        {
            Race race = new Race(context);
            if (options != null)
                race.Options = options;

            race.Load(id);
            return race;
        }
        #endregion
    }
}
